package com.zdxlz.fcmp.common.core.constant.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description：登陆类型枚举
 * @author：aman
 * @date：2025/3/7 13:42
 */
@Getter
@AllArgsConstructor
public enum LoginTypeEnums {

    LOGIN(1, "登陆系统"),

    LOGOUT(2, "登出系统"),
    ;

    @EnumValue
    private final Integer code;
    private final String name;

    public static LoginTypeEnums getByCode(Integer code) {
        for (LoginTypeEnums statusEnums : LoginTypeEnums.values()) {
            if (statusEnums.getCode().equals(code)) {
                return statusEnums;
            }
        }
        return null;
    }

    @JsonValue
    public Integer getCode() {
        return code;
    }

}
